Tag Link | [String->Digit] | Category | String |
---|---|---|---|
Type | Member | Source Available | No |
Support | Preferred | Version | 7.0 |
Change | Unchanged | Data Source | Any |
Output Type | Integer | Security | None |
Implementation | LCAPI | Sets | Lasso 8.5, Lasso 8.0, Lasso 7.0 |
[String->Digit] returns the integer value of a specified character for a specified radix or -1 if the character is not defined for the specified radix. The character within the base string to be inspected is specified starting from 1 for the first character in the string.
A radix of 16 can be used to return the value of a hexadecimal digit (0-9 and A
[Output: 'FFFFFF'->(Digit: 4,16)]
<?LassoScript
Variable: 'myString' = '00001000';
Variable: 'Result' = $myString->(Digit: 5, 2);
?gt;
Required Parameters | |
---|---|
Position | The character within the string to inspect. |
Radix | The radix of the result (e.g. 2 for binary, 8 for octal, 16 for hexadecimal). |
To return the digit value for a character within a specific base:
Use the [String->Digit] tag. The following example returns the value of the fourth character in hexadecimal base 16. The result for C in base 16 is 12.
[Output: 'DEFC012'->(Digit: 4, 16)]
15